<?php
header('Content-type: text/json');
// 连接数据库
$link=mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS);
//sql语句
$sql="SELECT * FROM test WHERE t_id LIKE '%$_POST[search]%'";
//如果连接成功
if($link)
{
    mysql_select_db(SAE_MYSQL_DB,$link);
}else{
    die('Could not connect: ' . mysql_error());
};
$result=mysql_query($sql,$link);
$users=array();
$i=0;
while($row=mysql_fetch_array($result,MYSQL_ASSOC)){
$users[$i]=$row;
$i++;
};
echo json_encode($users);
mysql_close($link);
?>